<template>
  <div>
    <van-nav-bar
  title="我的出租"
  left-arrow
  @click-left="onClickLeft"
/>
<van-empty description="您还没有房源，去发布房源吧~" v-if="isAppear"/>

  <Houselist v-for="item in list" :key="item.id" :item="item"></Houselist>
  </div>
</template>

<script>
import Houselist from '@/components/Houselist.vue'
import { myHouses } from '@/api/collect'
// import { getToken } from '@/utils/storage'
export default {
  name: 'HkzfVantLease',
  components: {
    Houselist
  },
  data () {
    return {
      list: [],
      isAppear: true
    }
  },
  async created () {
    const res = await myHouses()
    console.log(res)
    // getToken(res.body)
    this.list = res.body
    if (res.status === 200) {
      this.isAppear = false
    }
  },
  methods: {
    onClickLeft () {
      this.$router.push('/my')
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
